package com.ts.camera2.TsCamera

import android.content.Context
import android.view.SurfaceHolder
import android.view.SurfaceView

class TsCameraSurfaceView(context: Context) : SurfaceView(context), SurfaceHolder.Callback {

    var mCamera2Util:Camera2Util?=null
    constructor(context: Context, attrs: android.util.AttributeSet) : this(context) {
        holder.addCallback(this)
        mCamera2Util=Camera2Util()
    }

    override fun surfaceCreated(holder: SurfaceHolder) {
        mCamera2Util?.openCamera2(context,holder.surface)
    }

    override fun surfaceChanged(holder: SurfaceHolder, format: Int, width: Int, height: Int) {

    }

    override fun surfaceDestroyed(holder: SurfaceHolder) {

    }


}